<template>
	<view class="card-content">
		
		<view class="title">{{card.title}}</view>
		
		<rich-text class="tcontent" :nodes="card.content"></rich-text>
		
		<view class="images">
			<u-image v-for="(item,index) in card.images" :src="item" class="image" height="300"width="300" @click="selectImage(index)"></u-image>
		
		</view>
		
		<view class="time">{{card.time}}</view>
		<u-popup v-model="showImage" height="1800" width="2880" mode="center" :closeable="true" close-icon-size="60" :mask="true" :duration="200">
			<u-image :src="card.images[clickImageIndex]"height="1800" width="2880" mode="aspectFit"></u-image>
		</u-popup>
	</view>
</template>

<script>
	export default {
		props:{
			card:{
				type:Object
			}
		},
		name:"BigCard",
		data() {
			return {
				clickImageIndex:-1,
				showImage:false
			};
		},
		methods:{
			selectImage(index){
				this.clickImageIndex = index
				this.showImage = true
			}
		}
	}
</script>

<style lang="scss">
	$font-color:#686868;
	.card-content{
		height: 100%;
		width: 100%;
		padding: 20rpx;
		display: flex;
		flex-direction: column;
		//border: 2rpx red solid;
		position: relative;
		flex-wrap: wrap;
		.title{
			font-size: 60rpx;
			font-weight: bold;
		}
		.tcontent{
			font-size: 50rpx;
			text-indent: 2em;
			color: $font-color;
			height: auto;
			width: 100%;
			margin-top: 20rpx;
			overflow: auto;
		}
		.images{
			display: flex;
			flex-direction: row;
			height: 900rpx;
			position: absolute;
			left: 20rpx;
			bottom: 200rpx;
			align-items: flex-end;
			
			.image{
				margin-right: 20rpx;
			}
		}
		.time{
			position: absolute;
			right: 40rpx;
			color: $font-color;
			bottom: 40rpx;
		}
	}
</style>
